perm filename LOGO.MF[MF,DEK] blob sn#779655 filedate 1984-12-15 generic text, type T, neo UTF8
% Routines for the METAFONT logo
mode_setup;

def arc(suffix i,j) =
       (z.i{0,y.j-y.i}..
	(beta[x.i,x.j],beta[y.j,y.i]){z.j-z.i}..
	z.j{x.j-x.i,0}) enddef;

def double_arc(suffix i,j,k) =
	arc(i,j) & reverse arc(k,j) enddef;

alpha:=.45;	% controls bar location and similar things
beta:=.2;	% controls squareness of bowls

yy#:=xx#; define_whole_pixels(xx,yy);
define_pixels(s,u);
define_corrected_pixels(o);
py#=.9px#; define_blacker_pixels(px,py);
pickup pencircle xscaled px yscaled py;
logo_pen:=savepen;

leftstemloc:=good.x((2.5u#+s#)*pt);
barheight:=good.y(alpha*ht#*pt);

def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
	beginchar(code.c,n*u#+2s#,ht#,0); pickup logo_pen enddef;

beginchar("M",18*u#+2s#,ht#,0); pickup logo_pen;
x1+x5=x2+x4=2x3=w; x1=x2=leftstemloc;
y1=y5; y2=y4; bot.y1=-o; top y2=h+o; bot.y3=yy-epsilon;
draw z1--z2--z3--z4--z5;
labels(1,2,3,4,5);
endchar;

beginchar("E",14*u#+2s#,ht#,0); pickup logo_pen;
x1+x6=x2+x5+xx=x3+x4=w+o; x1=x2=x3=leftstemloc;
y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=barheight;
draw z6--z1--z3--z4; draw z2..z5;
labels(1,2,3,4,5,6);
endchar;

beginchar("T",13*u#+2s#,ht#,0); pickup logo_pen;
if odd(w-px): w:=w+1; fi	% allows a symmetric stem
x1+x2=2x3=2x4=w; lft.x1=-epsilon; % I tried s-o instead; was not as good
y1=y2=y3; top.y1=h; bot.y4=-o;
draw z1..z2; draw z3..z4;
labels(1,2,3,4);
endchar;

beginchar("A",15*u#+2s#,ht#,0);	pickup logo_pen;
x1+x4=x2+x3=2x5=w; x1=x2=leftstemloc;
y1=y4; y2=y3; bot.y1=-o; top.y5=h+o; y2=barheight;
draw double_arc(2,5,3); draw z1--z2--z3--z4;
labels(1,2,3,4,5);
endchar;

beginchar("F",14*u#+2s#,ht#,0); pickup logo_pen;
x2+x5+xx=x3+x4=w; x1=x2=x3=leftstemloc;
y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=barheight;
draw z1--z3--z4; draw z2..z5;
labels(1,2,3,4,5);
endchar;

beginchar("O",15*u#+2s#,ht#,0); pickup logo_pen;
x1+x2=x3+x4=w; x1=good.x(1.5u+s); x3=x4;
bot.y3=-o; top.y4=h+o; y1=y2=barheight;
draw double_arc(1,4,2); draw double_arc(2,3,1);
labels(1,2,3,4);
endchar;

beginchar("N",15*u#+2s#,ht#,0); pickup logo_pen;
x1+x4=x1+x3=x2+x5=w; x1=x2=leftstemloc;
y1=y4=y3-yy; bot.y1=-o; y2=y5; top.y5=h+o;
draw z1--z2--z3; draw z4..z5;
labels(1,2,3,4,5);
endchar;

ligtable "T": "A" kern -.5u#;
ligtable "F": "O" kern -u#;